package com.yan.test.test1;

/**
 * @author taoge
 * @Date 2024/8/8 18:43
 * @Description
 */
public class NumberPrinter extends  Thread{
    private  Printer p;
    int index = 1;
    public NumberPrinter(Printer p) {
        this.p = p;
    }

    public NumberPrinter(String name, Printer p) {
        super(name);
        this.p = p;
    }

    @Override
    public void run() {
        for (int i = 1; i <= 52; i++) {
            p.print(i);
        }
    }
}
